package cn.bingoo.lang;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

public class Files {
    public static void writeStringToFile(File file, String text) throws IOException {
        OutputStreamWriter out = null;
        try {
            out = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
            out.write(text);
        }
        finally {
            Ios.closeQuietly(out);
        }
    }
}
